# This is Dockerfile
# Version: 1.0

# Base image
FROM golang

# Authors
MAINTAINER Lao Wang

# WORKDIR
WORKDIR /go/src/app

# ENV
ENV GOPROXY=https://goproxy.cn

# COPY
COPY ./go.mod ./
COPY ./go.sum ./

# RUN 
# RUN go mod download
RUN go mod vendor

# COPY
COPY . .

# RUN
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./main.go

# CMD
CMD ["./main"]